package test1225;

public class Test07 {
    public static void main(String[] args) {
        // 打印arr与brr的差集
        int[] arr = {1,2,3,4,5};
        int[] brr = {3,4,5,6,7};
        m07(arr, brr);
    }
    public static void m07(int[] arr, int[] brr) {
        int[] crr = new int[arr.length];
        int jiao = 0;
        for(int i = 0; i < arr.length; i++) {
            boolean kai_guan = false;
            for(int k = 0; k < brr.length; k++) {
                if(arr[i] == brr[k]) {
                    kai_guan = true;
                }
            }
            if(!kai_guan) {
                crr[jiao] = arr[i];
                jiao++;
            }
        }
        for(int i = 0;i<brr.length;i++){
            boolean kaiguan = false;
            for(int j = 0;j<arr.length;j++){
                if(brr[i]==arr[j]){
                    kaiguan = true;
                    break;
                }
            }
            if(!kaiguan){
                crr[jiao] = brr[i];
                jiao++;
            }
        }
        for(int i = 0; i < crr.length; i++) {
            if(crr[i] != 0) {
                System.out.print(crr[i] + " ");
            }
        }
    }
}
